export default function (param) {
    let tabName = param.tabName || "vue"+Math.floor(Math.random() * 10000);
    let tabNumber = param.tabNumber || "vue"+Math.floor(Math.random() * 10000);
    let component = {
        extends: param.component,
        name: tabNumber
    }
    let path = param.tabNumber ? param.tabNumber + tabName : tabName + param.component.name;

    this.$router.addRoutes([{
        path: '/',
        name: 'Home',
        meta:{
            label: '首页'
        },
        component:() => import("@/views/Home"),
        children:[{
            path: '/' + path +'/:moduleName' ,
            name: tabNumber,
            meta: {
                label: tabName
            },
            component: component
        }]
    }])
    this.$router.push({
        path: '/' + path +'/:moduleName' ,
        name:tabNumber,
        query: Object.assign(param,param.query || {},{moduleName:"worktab_1"}) || {
            moduleName:"worktab_1",
        },
        params: Object.assign(param,param.query || {},{moduleName:"worktab_1"}) || {
            moduleName:"worktab_1",
        }
    })
}
